﻿@using Model.Database
@*旧版本的左侧菜单（灵活性高，手动编写菜单生成格式）*@
@model Model.Database.UserInfo
@{
    if (Model != null && Model.Roles.FirstOrDefault() != null)
    {
        List<Power> powerList = Model.Roles.First().Powers.ToList();

        foreach (var powerOne in powerList.Where(a => a.ParentId == "0" || a.PowerId.Length == 4).OrderBy(a => a.Sort))//一级菜单
        {
            <dl id="menu-@powerOne.PowerId">
                <dt><i class="Hui-iconfont">&#xe616;</i> @powerOne.PowerName<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
                <dd>
                    <ul>
                @{
                    foreach (var powerTwo in powerList.Where(a => a.ParentId != "0" && a.PowerId.Length == 8 && a.PowerId.EndsWith("00") && a.ParentId == powerOne.PowerId).OrderBy(a => a.Sort))//二级菜单
                    {
                        <li><a data-href="@powerTwo.Url?powerId=@powerTwo.PowerId" data-title="@powerTwo.PowerName" href="javascript:void(0)">@powerTwo.PowerName</a></li>
                    }
                }
                    </ul>
                </dd>
            </dl>
        }
    }
}
